package top.kaoshanji.p1ch04a;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * 代码清单-p1ch04a-113页a：在JavaConfig中启用AspectJ注解的自动代理
 * @author kaoshanji
 * ^_^
 * create time 2025/4/23 15:44
 */
@Configuration
@EnableAspectJAutoProxy
@ComponentScan
public class PerformanceConfig {

    /**
     * 代码清单-p1ch04a-113页b：将切面Audience定义为一个bean
     * @return Audience
     */
    @Bean
    public Audience audience() {
        return new Audience();
    }

    /**
     * 代码清单-p1ch04a-120页b：将切面EncoreableIntroducer定义为一个bean
     * @return
     */
    @Bean
    public EncoreableIntroducer encoreableIntroducer() {
        return new EncoreableIntroducer();
    }

}
